﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ManagementModule.cs" company="Concept Architecture">
//   (c) 2010 Muhammad Umer Farooq
// </copyright>
// <summary>
//   Defines the <seealso cref="ManagementModule" /> type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Hisaab.Client.Modules.Core.Management
{
    using Common;
    using Microsoft.Practices.Prism.Modularity;
    using Microsoft.Practices.Prism.Regions;
    using Microsoft.Practices.ServiceLocation;
    using Microsoft.Practices.Unity;
    using Tabs;
    using View;

    /// <summary>
    /// Defines the <seealso cref="ManagementModule"/> type.
    /// </summary>
    public class ManagementModule : IModule
    {
        /// <summary>
        /// Member variable ImportBankData
        /// </summary>
        public const string ImportBankData = "ImportBankData";

        /// <summary>
        /// Initializes this instance.
        /// </summary>
        public void Initialize()
        {
            var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
            regionManager.RegisterViewWithRegion(Regions.BackStageRegion, typeof(ImportBackstageTab));
            regionManager.RegisterViewWithRegion(Regions.BackStageRegion, typeof(BackupBackstageTab));
            regionManager.RegisterViewWithRegion(Regions.BackStageRegion, typeof(OptionBackstageTab));
            regionManager.RegisterViewWithRegion(Regions.BackStageRegion, typeof(UserManagementBackstageTab));

            var container = ServiceLocator.Current.GetInstance<IUnityContainer>();
            container.RegisterType<object, ImportBankDataView>(ImportBankData);
        }
    }
}